package org.htmlparser.parserapplications;

import java.io.PrintStream;
import org.htmlparser.beans.StringBean;
import org.htmlparser.util.ParserException;

public class StringExtractor
{
  private String resource;

  public StringExtractor(String paramString)
  {
    this.resource = paramString;
  }

  public static void main(String[] paramArrayOfString)
  {
    StringExtractor localStringExtractor;
    boolean bool = false;
    String str = null;
    int i = 0;
    if (i < paramArrayOfString.length)
    {
      if (paramArrayOfString[i].equalsIgnoreCase("-links"))
        bool = true;
      while (true)
      {
        while (true)
          ++i;
        str = paramArrayOfString[i];
      }
    }
    if (str != null)
      localStringExtractor = new StringExtractor(str);
    try
    {
      System.out.println(localStringExtractor.extractStrings(bool));
      return;
    }
    catch (ParserException localParserException)
    {
      while (true)
        localParserException.printStackTrace();
      System.out.println("Usage: java -classpath htmlparser.jar org.htmlparser.parserapplications.StringExtractor [-links] url");
    }
  }

  public String extractStrings(boolean paramBoolean)
    throws ParserException
  {
    StringBean localStringBean = new StringBean();
    localStringBean.setLinks(paramBoolean);
    localStringBean.setURL(this.resource);
    return localStringBean.getStrings();
  }
}